package com.jilefojing.beans.pojos.enhanced;

import java.util.Date;
import java.util.List;

import com.jilefojing.beans.enums.ProgressStatusForSource;
import com.jilefojing.beans.enums.StatusEnumForPublish;
import com.jilefojing.beans.pojos.EArticle;
import com.jilefojing.beans.pojos.enhanced.base.BaseEnhanced;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年10月03日 16时03分48秒
 */
public class EnhancedEArticle extends BaseEnhanced {
	public EnhancedEArticle(EArticle eArticle) {
		// TODO 自动生成 细微误差自己调整
		if (eArticle.getId() != null) {
			this.id = eArticle.getId();
		}
		this.title = eArticle.getTitle();
		this.content = eArticle.getContent();
		if (eArticle.getSort() != null) {
			this.sort = eArticle.getSort();
		}
		if (eArticle.getCreateUser() != null) {
			EnhancedUser enhancedUser = new EnhancedUser();
			enhancedUser.setId(eArticle.getCreateUser());
			this.enhancedCreateUser = enhancedUser;
		}
		this.updateTime = eArticle.getUpdateTime();
		this.createTime = eArticle.getCreateTime();

		if (eArticle.getEntity() != null) {
			if (eArticle.getEntity() == 1) {
				this.entity = true;
			}
		}

		if (eArticle.getParentId() != null && eArticle.getParentId() > 0) {
			EnhancedEArticle _enhancedParentEArticle = new EnhancedEArticle();
			_enhancedParentEArticle.setId(eArticle.getParentId());
			this.enhancedParent = _enhancedParentEArticle;
		}
		this.copyPublishTime = eArticle.getCopyPublishTime();
		this.copyWebsiteName = eArticle.getCopyWebsiteName();
		this.copyWebsiteUrl = eArticle.getCopyWebsiteUrl();

		if (eArticle.getStatus() != null) {
			this.status = StatusEnumForPublish.getStatusEnumByCode(eArticle
					.getStatus());
		}

		if (eArticle.getProgressStatus() != null) {
			this.progressStatus = ProgressStatusForSource
					.getProgressStatusEnumByCode(eArticle.getProgressStatus());
		}

	}

	public EnhancedEArticle() {
	}

	private long id;
	private String title;
	private String content;
	private double sort;
	private EnhancedUser enhancedCreateUser;
	private Date updateTime;
	private Date createTime;
	private Date copyPublishTime;
	private String copyWebsiteName;
	private String copyWebsiteUrl;
	private boolean entity;
	private EnhancedEArticle enhancedParent;

	private List<EnhancedEArticle> enhancedChildren;
	private EnhancedAttitude enhancedAttitude;// 用户态度
	private EnhancedStatistics enhancedStatistics;
	private List<EnhancedTag> enhancedTags;
	private EnhancedRFavoriteSource enhancedRFavoriteSource;

	private StatusEnumForPublish status;
	private ProgressStatusForSource progressStatus;

	private List<EnhancedDCategory> enhancedDCategories;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public double getSort() {
		return sort;
	}

	public void setSort(double sort) {
		this.sort = sort;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public EnhancedStatistics getEnhancedStatistics() {
		return enhancedStatistics;
	}

	public void setEnhancedStatistics(EnhancedStatistics enhancedStatistics) {
		this.enhancedStatistics = enhancedStatistics;
	}

	public Date getCopyPublishTime() {
		return copyPublishTime;
	}

	public void setCopyPublishTime(Date copyPublishTime) {
		this.copyPublishTime = copyPublishTime;
	}

	public String getCopyWebsiteName() {
		return copyWebsiteName;
	}

	public void setCopyWebsiteName(String copyWebsiteName) {
		this.copyWebsiteName = copyWebsiteName;
	}

	public String getCopyWebsiteUrl() {
		return copyWebsiteUrl;
	}

	public void setCopyWebsiteUrl(String copyWebsiteUrl) {
		this.copyWebsiteUrl = copyWebsiteUrl;
	}

	public boolean isEntity() {
		return entity;
	}

	public void setEntity(boolean entity) {
		this.entity = entity;
	}

	public EnhancedEArticle getEnhancedParent() {
		return enhancedParent;
	}

	public void setEnhancedParent(EnhancedEArticle enhancedParent) {
		this.enhancedParent = enhancedParent;
	}

	public List<EnhancedEArticle> getEnhancedChildren() {
		return enhancedChildren;
	}

	public void setEnhancedChildren(List<EnhancedEArticle> enhancedChildren) {
		this.enhancedChildren = enhancedChildren;
	}

	public EnhancedAttitude getEnhancedAttitude() {
		return enhancedAttitude;
	}

	public void setEnhancedAttitude(EnhancedAttitude enhancedAttitude) {
		this.enhancedAttitude = enhancedAttitude;
	}

	public List<EnhancedTag> getEnhancedTags() {
		return enhancedTags;
	}

	public void setEnhancedTags(List<EnhancedTag> enhancedTags) {
		this.enhancedTags = enhancedTags;
	}

	public EnhancedRFavoriteSource getEnhancedRFavoriteSource() {
		return enhancedRFavoriteSource;
	}

	public void setEnhancedRFavoriteSource(
			EnhancedRFavoriteSource enhancedRFavoriteSource) {
		this.enhancedRFavoriteSource = enhancedRFavoriteSource;
	}

	public EnhancedUser getEnhancedCreateUser() {
		return enhancedCreateUser;
	}

	public void setEnhancedCreateUser(EnhancedUser enhancedCreateUser) {
		this.enhancedCreateUser = enhancedCreateUser;
	}

	public StatusEnumForPublish getStatus() {
		return status;
	}

	public void setStatus(StatusEnumForPublish status) {
		this.status = status;
	}

	public ProgressStatusForSource getProgressStatus() {
		return progressStatus;
	}

	public void setProgressStatus(ProgressStatusForSource progressStatus) {
		this.progressStatus = progressStatus;
	}

	public List<EnhancedDCategory> getEnhancedDCategories() {
		return enhancedDCategories;
	}

	public void setEnhancedDCategories(
			List<EnhancedDCategory> enhancedDCategories) {
		this.enhancedDCategories = enhancedDCategories;
	}

}